﻿using IdentityServer4;
using IdentityServer4.Models;
using IDSS.Core.Interfaces;
using System.Collections.Generic;

namespace IDSS.Test
{
    public class ClientsProvider : IClientsProvider
    {
        private static readonly IEnumerable<Client> clients = new List<Client> 
        { 
            new Client
            {
                ClientId = "client",
                ClientSecrets =
                {
                    new Secret("secret".Sha256()),
                },
                AllowedGrantTypes = GrantTypes.ClientCredentials,
                AllowedScopes =
                {
                    "api1",
                },
            },
            new Client
            {
                ClientId = "mvc",
                ClientSecrets =
                {
                    new Secret("secret".Sha256()),
                },
                AllowedGrantTypes = GrantTypes.Code,
                RedirectUris = { "https://localhost:5002/signin-oidc" },
                PostLogoutRedirectUris = { "https://localhost:5002/signout-callback-oidc" },
                AllowedScopes =
                {
                    IdentityServerConstants.StandardScopes.OpenId,
                    IdentityServerConstants.StandardScopes.Profile,
                    IdentityServerConstants.StandardScopes.Email,
                    IdentityServerConstants.StandardScopes.Address,
                    IdentityServerConstants.StandardScopes.Phone,
                    "api1",
                }
            }
        };

        public IEnumerable<Client> Clients => clients;
    }
}
